<?php

namespace App\Http\Livewire\Messages;

use Livewire\Component;

class Show extends Component
{
    public $title;
    public $content;
    public $type = 'info';
    public $timeout = 3000;
    public $revoke = false;
    public $buttons = [];
    public $visible = false;
    protected $listeners = ['showMessage'];

    public function showMessage($message = [])
    {
        $this->fill($message);
        $this->visible = true;
        $this->emit('show', $this->timeout);
    }

    public function render()
    {
        return view('livewire.messages.show');
    }
}
